package com.ss.android.article.base.feature.feed.activity;

import android.animation.ValueAnimator;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.os.Looper;
import android.os.Message;
import android.support.v4.app.FragmentActivity;
import android.support.v4.util.SparseArrayCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.FrameLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.bytedance.article.common.c.JSONObjectWrapper;
import com.bytedance.article.common.c.TTUtils;
import com.bytedance.common.utility.Logger;
import com.bytedance.common.utility.UIUtils;
import com.bytedance.common.utility.c.SharedPreferenceCompat;
import com.bytedance.common.utility.collection.WeakHandler;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
import com.ss.android.account.Spipe;
import com.ss.android.action.ActionThreadV3;
import com.ss.android.action.ArticleActionHelper;
import com.ss.android.action.BatchActionHelper;
import com.ss.android.action.a.c.ShareDialog;
import com.ss.android.action.bb;
import com.ss.android.article.base.app.AppData;
import com.ss.android.article.base.feature.a.CmdHandler;
import com.ss.android.article.base.feature.app.b.DBHelper;
import com.ss.android.article.base.feature.c.FeedAdapter;
import com.ss.android.article.base.feature.c.FeedItemBehavior;
import com.ss.android.article.base.feature.detail.presenter.DetailHelper;
import com.ss.android.article.base.feature.e.ArticleShareHelper;
import com.ss.android.article.base.feature.feed.c.FilterWord;
import com.ss.android.article.base.feature.feed.dd;
import com.ss.android.article.base.feature.feed.presenter.ArticleActionThread;
import com.ss.android.article.base.feature.feed.presenter.DislikeActionReportThread;
import com.ss.android.article.base.feature.feed.presenter.ListData;
import com.ss.android.article.base.feature.feed.presenter.m;
import com.ss.android.article.base.feature.model.Article;
import com.ss.android.article.base.feature.model.CellRef;
import com.ss.android.article.base.feature.model.DownloadAppAd;
import com.ss.android.article.base.feature.model.FeedCallAppAd;
import com.ss.android.article.base.ui.LoadingFlashView;
import com.ss.android.article.base.ui.NoDataViewFactory$ImgType;
import com.ss.android.article.base.ui.NoNetView;
import com.ss.android.article.base.ui.NotifyViewHelper;
import com.ss.android.article.base.ui.OnRemoveAnmatorFinishListener;
import com.ss.android.article.base.ui.ac;
import com.ss.android.article.base.ui.ad;
import com.ss.android.article.base.ui.ar;
import com.ss.android.article.base.ui.as;
import com.ss.android.article.base.utils.ActionSendRecoder;
import com.ss.android.article.browser.R;
import com.ss.android.b.a.AdsAppItem;
import com.ss.android.common.ad.MobAdClickCombiner;
import com.ss.android.common.app.AbsFragment;
import com.ss.android.common.callback.CallbackCenter;
import com.ss.android.common.callback.SSCallback;
import com.ss.android.common.lib.MobClickCombiner;
import com.ss.android.common.ui.view.PinnedHeaderListView;
import com.ss.android.common.util.NetworkStatusMonitor;
import com.ss.android.common.util.NetworkUtils;
import com.ss.android.common.util.UrlBuilder;
import com.ss.android.messagebus.SubscriptionRouter;
import com.ss.android.model.AbsArticle;
import com.ss.android.model.BaseArticle;
import com.ss.android.model.ItemActionV3;
import com.ss.android.newmedia.BaseAppData;
import com.ss.android.newmedia.MediaAppData;
import com.ss.android.newmedia.a.AbstractFooter;
import com.ss.android.newmedia.a.AdsAppBaseActivity;
import com.ss.android.newmedia.a.PopupToast;
import com.ss.android.newmedia.activity.browser.BrowserActivity;
import com.ss.android.newmedia.e.ShareHelper;
import com.ss.android.newmedia.util.AppUtil;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.lang.ref.WeakReference;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

import inline.TempBean;

public abstract class ArticleListFragment extends AbsFragment implements
        AbsListView.OnScrollListener,
        WeakHandler.Callback,
        com.handmark.pulltorefresh.library.PullToRefreshAdapterViewBase.a,
        AppData.a$d,
        CmdHandler.a$a,
        FeedItemBehavior {
    public static final int MSG_REFRESH_TIPS = 102;
    protected static final int NOTIFY_ACTION_ADS_TIP = 1;
    protected static final int NOTIFY_ACTION_DISLIKE = 2;
    protected static final int NOTIFY_ACTION_NONE = 0;
    protected static final boolean SET_ITEM_CLICK_LISTENER = false;
    private static final String TAG = "ArticleListFragment";
    public final List<CellRef> mData = new ArrayList();
    public final ListData mListData = new ListData();
    private final int mAnimationTime = 200;
    public m dislikeDialogManager;
    public FeedAdapter mAdapter;
    public AdsAppItem mAdsAppItem;
    public AppData mAppData;
    public ArticleActionHelper mArticleActionHelper;
    public ArticleShareHelper mArticleShareHelper;
    public View mClickedPopIcon = null;
    public Context mContext;
    public DetailHelper mDetailHelper;
    public com.ss.android.article.base.ui.DiggAnimationView mDiggAnimationView;
    public FeedActionDialogManager mFeedActionDialogManager;
    public Footer mFooter;
    public boolean mIsLoading = false;
    public ListView mListView;
    public NetworkStatusMonitor mNetworkMonitor;
    public NoNetView mNoDataView;
    public PullToRefreshListView mPullRefreshList;
    public View mRootView;
    public Spipe mSpipe;
    protected BatchActionHelper batchActionHelper;
    protected com.ss.android.article.base.feature.feed.dd.a dislikeBtnClickListener;
    protected ArticleActionHelper mActionHelper;
    protected CellRef mCurrentCellRef;
    protected String mDefaultAds;
    protected View.OnClickListener mDislikeListener;
    protected WeakReference mDislikePopRef;
    protected WeakReference mDislikePopWindowRef;
    protected TextView mEmptyNotifyView;
    protected View.OnClickListener mFavorListener;
    protected TextView mFootLoading;
    protected WeakHandler mHandler = new WeakHandler(Looper.getMainLooper(), this);
    protected Runnable mHideNotifyTask;
    protected boolean mIsNightMode = false;
    protected boolean mIsPullingToRefresh = false;
    protected AdapterView.OnItemClickListener mItemClick;
    protected int mLastClickItemIndex = -1;
    protected CellRef mLastDislikedItem = null;
    protected long mLastLoadMoreTimestamp = 0;
    protected boolean mLastReadLocalEnable;
    protected int mLastScrollState = 0;
    protected View.OnTouchListener mListTouchListener;
    protected TextView mLoadMore;
    protected NoNetView mNoNetView;
    protected View mNotifyDivider;
    protected View mNotifyView;
    protected View mNotifyViewCancel;
    protected View mNotifyViewCancelLayout;
    protected NotifyViewHelper mNotifyViewHelper;
    protected TextView mNotifyViewText;
    protected View.OnClickListener mOnCloseDlgListener;
    protected SSCallback mOnReceiveSendEventCallback;
    protected int mPendingIndex = 0;
    protected CellRef mPendingItem = null;
    protected Animation mPopAnim;
    protected PopupToast mPopupToast;
    protected int mReferType = 1;
    protected boolean mRefreshFromDislike;
    protected int mSectionHeight = 0;
    protected ShareDialog mShareDialog;
    protected ShareHelper mShareHelper;
    protected List mStickDatas;
    protected UgcEventHelper mUgcEventHelper;
    protected WindowManager mWindowManager;
    SSCallback mMoreActionCallback;
    dd.WindowFocusChangeListener mWindowFocusChangeListener;
    private ActionSendRecoder mActionSendRecoder;
    private CmdHandler mCmdHandler;
    private LoadingFlashView mEmptyView;
    private OnRemoveAnmatorFinishListener mOnRemoveAnmatorFinishListener;

    public ArticleListFragment() {
        this.mOnReceiveSendEventCallback = new SSCallback() {

            @Override
            public Object onCallback(Object[] args) {
                Object v3 = null;
                Object v0 = args[0];
                Object v1 = args[1];
                if (v0 == ArticleListFragment.this) {
                    CallbackCenter.abortDispatch();
                    if (v1 == null) {
                        Logger.throwException("ref not valid!");
                    } else {
                        v0 = args[2];
                        ensureUgcEventHelper();
                        mUgcEventHelper.mCellRef = ((CellRef) v1);
                        mUgcEventHelper.reportEvent(((String) v0));
                    }
                }

                return v3;
            }
        };
        this.mHideNotifyTask = new Runnable() {
            @Override
            public void run() {
                doHideNotify(getNotifyAction());
            }
        };
        this.mFavorListener = new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Object v0 = null;
                if (mDislikePopRef != null) {
                    v0 = mDislikePopRef.get();
                }

                if (v0 != null) {
                    ((PopupWindow) v0).dismiss();
                }

                onFavorClick();
            }
        };
        this.mDislikeListener = new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Object v0 = null;
                if (mDislikePopWindowRef != null) {
                    v0 = mDislikePopWindowRef.get();
                }

                if (v0 != null) {
                    ((ag) v0).d.dismiss();
                }

                if (mPendingItem != null) {
                    onDislikeClick(true);
                }
            }
        };
        this.mOnCloseDlgListener = new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Object v0 = null;
                if (mDislikePopRef != null) {
                    v0 = mDislikePopRef.get();
                }

                if (v0 != null) {
                    ((PopupWindow) v0).dismiss();
                }
            }
        };
        this.mItemClick = new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> arg4, View arg5, int arg6, long arg7) {
                int v0 = mListView.getHeaderViewsCount();
                v0 = v0 > 0 ? arg6 - v0 : arg6;
                if (v0 < 0) {
                    v0 = 0;
                }

                handleItemClick(v0, arg5, new Object[0]);
            }
        };
        this.mMoreActionCallback = new SSCallback() {

            public final Object onCallback(Object[] args) {
                if (mCurrentCellRef != null) {
                    ensureUgcEventHelper();
                    mUgcEventHelper.reportEvent("show_dislike_with_reason");
                }
                return null;
            }
        };
        this.mWindowFocusChangeListener = new dd.WindowFocusChangeListener(this);
        this.dislikeBtnClickListener = new com.ss.android.article.base.feature.feed.dd.a(this);
        this.mOnRemoveAnmatorFinishListener = new OnRemoveAnmatorFinishListener() {
            @Override
            public void a(View arg3, boolean arg4) {
                if (!arg4) {
                    if (mAdapter != null) {
                        mAdapter.mAnimatorHashMap.remove(arg3);
                    }

                    mRefreshFromDislike = containsHasMoreRefreshCell();
                    deleteDismissedItem();
                }
            }
        };
    }

    static ViewGroup wrap(View contentView) {
        FrameLayout frameLayout = new FrameLayout(contentView.getContext());
        ViewGroup.LayoutParams lp = contentView.getLayoutParams();
        if (lp != null) {
            frameLayout.setLayoutParams(lp);
        }

        contentView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        frameLayout.addView(contentView);
        return frameLayout;
    }

    protected boolean isLastReadEnable() {
        return this.mLastReadLocalEnable && this.mAppData.lastReadRefresh() && AppData.getInstance().getAbSettings().isFeedShowLastReadDocker();
    }

    public void addListHeader() {
    }

    private boolean canCallSDKSuccess(CellRef cellRef) {
        if (cellRef != null && cellRef.article != null) {
            if (android.support.design.a.isTextEmpty(cellRef.article.openUrl)) {
                return false;
            }

            if (!cellRef.article.openUrl.startsWith("jdsdk://") && !cellRef.article.openUrl.startsWith("taobaosdk://")) {
                return false;
            }

            JSONObject jsonObject = new JSONObject();
            try {
                if (!android.support.design.a.isTextEmpty(cellRef.logExtra)) {
                    jsonObject.put("log_extra", cellRef.logExtra);
                }
            } catch (Exception e) {
            }

            try {
                String host = Uri.parse(cellRef.article.articleUrl).getHost();
                if (!android.support.design.a.isTextEmpty(host)) {
                    AppData.Y();
                    if (host.contains(".jd.com")) {
                        AppData.Z();
                    } else {
                        return false;
                    }
                } else {
                    return false;
                }

            } catch (Exception e) {
                Logger.d("ArticleListFragment", e.toString());
            }
        }
        return false;
    }

    private void checkAdGroupClick(int arg11, boolean arg12) {
        JSONObject v8;
        JSONObject v1_1;
        JSONObject v2 = null;
        long v6 = 0;
        if (this.getActivity() != null) {
            Object v0 = this.mAdapter.a(arg11);
            if (!(v0 instanceof CellRef)) {
                return;
            }

            if (((CellRef) v0).article == null) {
                return;
            }

            if (!((CellRef) v0).a()) {
                return;
            }

            if (((CellRef) v0).article.groupId <= v6) {
                return;
            }

            if (((CellRef) v0).adId <= v6) {
                return;
            }

            try {
                if (!android.support.design.a.isTextEmpty(((CellRef) v0).logExtra)) {
                    v1_1 = new JSONObject();
                    v1_1.put("log_extra", ((CellRef) v0).logExtra);
                } else {
                    v1_1 = v2;
                }

                v8 = v1_1;
            } catch (Exception v1) {
                v8 = v2;
            }
            MobAdClickCombiner.onAdEvent(this.mContext, "embeded_ad", "click", ((CellRef) v0).adId, v6, v8, 2);
        }
    }

    protected boolean containsHasMoreRefreshCell() {
        boolean v0_1;
        if (this.getData() == null || this.getData().size() <= 0) {
            label_16:
            v0_1 = false;
        } else {
            Iterator v1 = this.getData().iterator();
            do {
                if (v1.hasNext()) {
                    Object v0 = v1.next();
                    if (v0 == null) {
                        continue;
                    }

                    if (((CellRef) v0).cellType != -1) {
                        continue;
                    }

                    break;
                } else {
                    return false;
                }
            }
            while (true);

            v0_1 = true;
        }

        return v0_1;
    }

    public int contextType() {
        return 0;
    }

    void deleteDismissedItem() {
        if (this.isViewValid()) {
            this.refreshList();
        }
    }

    public abstract void doHandleItemClick(int arg1, CellRef arg2, View arg3, boolean arg4, boolean arg5);

    protected void doHideNotify() {
        this.doHideNotify(0);
    }

    protected void doHideNotify(int arg3) {
        if ((this.isViewValid()) && this.mNotifyView != null) {
            this.mHandler.removeCallbacks(this.mHideNotifyTask);
            this.mNotifyViewHelper.a(this.mNotifyView);
        }
    }

    protected void doOnActivityCreated() {
        this.mIsNightMode = false;
        this.mContext = this.getActivity();
        this.mSectionHeight = this.mContext.getResources().getDimensionPixelSize(R.dimen.hd);
        this.mWindowManager = (WindowManager) this.mContext.getSystemService(Context.WINDOW_SERVICE);
        this.mActionHelper = new ArticleActionHelper(this.mContext) {
            public final void a(int arg12, AbsArticle arg13, long arg14) {
                AbsArticle v7;
                AbsArticle v1 = null;
                if (arg12 != 9 && arg12 != 10) {
                    v7 = v1;
                } else if ((arg13 instanceof Article)) {
                    AbsArticle v0 = arg13;
                    if (((Article) v0).groupType == 1) {
                        v7 = v0;
                    } else {
                        v7 = v1;
                    }
                } else {
                    v7 = v1;
                }

                if (v7 != null) {
                    long v8 = System.currentTimeMillis();
                    bb.a();
                    bb.a(arg12, v8, v7);
                    if (((Article) v7).subjectGroupId > 0 && ((Article) v7).subjectGroupId != ((Article) v7).groupId) {
                        Article article = new Article(((Article) v7).subjectGroupId, 0, 0);
                        article.userDislike = arg12 == 9 ? true : false;
                        bb.a();
                        bb.a(arg12, v8, ((AbsArticle) article));
                    }

                    if (!NetworkUtils.isNetworkAvailable(this.a)) {
                        return;
                    }

                    new ArticleActionThread(this.a, this.b, arg12, v8, (Article) v7, arg14).start();
                } else {
                    super.a(arg12, arg13, arg14);
                }
            }

            public final void handleMsg(Message message) {
                Object v7;
                long v4 = 0;
                int v3 = 1005;
                int v9 = 9;
                Object v0 = null;
                if (message.what != 1006 && message.what != v3) {
                    v7 = v0;
                } else if ((message.obj instanceof DislikeActionReportThread)) {
                    v7 = message.obj;
                } else {
                    v7 = v0;
                }

                if (v7 == null) {
                    super.handleMsg(message);
                } else if (message.what == v3) {
                    if (((ArticleActionThread.Action) v7).a != v9 && ((ArticleActionThread.Action) v7).a != 10) {
                        return;
                    }

                    int v8 = ((ArticleActionThread.Action) v7).a;
                    if (((ArticleActionThread.Action) v7).article == null) {
                        return;
                    }

                    bb.a();
                    bb.a(v8, ((ArticleActionThread.Action) v7).c, ((ArticleActionThread.Action) v7).article, false);
                    if (((ArticleActionThread.Action) v7).e <= v4) {
                        return;
                    }

                    if (((ArticleActionThread.Action) v7).e == ((ArticleActionThread.Action) v7).article.groupId) {
                        return;
                    }

                    Article v1 = new Article(((ArticleActionThread.Action) v7).e, v4, 0);
                    boolean v0_1 = v8 == v9 ? true : false;
                    v1.userDislike = v0_1;
                    bb.a();
                    bb.a(v8, ((ArticleActionThread.Action) v7).c, ((AbsArticle) v1), false);
                }
            }
        };
        this.batchActionHelper = new BatchActionHelper(this.mContext);
        this.mShareHelper = new ShareHelper(this.mContext, this, this.mAppData);
        this.mNetworkMonitor = new NetworkStatusMonitor(this.getActivity());
        this.mSpipe = Spipe.inst();
        this.mCmdHandler = CmdHandler.inst(this.mContext);
        this.mCmdHandler.a.add(this);
        this.mAppData.bx.add(this);
        if (FeedActionDialogManager.c == null) {
            FeedActionDialogManager.c = new FeedActionDialogManager();
        }

        this.mFeedActionDialogManager = FeedActionDialogManager.c;
        if (m.a == null) {
            m.a = new m();
        }

        this.dislikeDialogManager = m.a;
    }

    protected void doOnViewCreated(View view) {
        LayoutInflater layoutInflater = LayoutInflater.from(this.getActivity());
        this.mRootView = view;
        this.mNotifyView = view.findViewById(com.ss.android.article.browser.R.id.notify_view);
        this.mNotifyViewText = this.mNotifyView.findViewById(com.ss.android.article.browser.R.id.notify_view_text);
        this.mNotifyViewCancelLayout = this.mNotifyView.findViewById(com.ss.android.article.browser.R.id.notify_view_cancel_layout);
        this.mNotifyDivider = this.mNotifyView.findViewById(com.ss.android.article.browser.R.id.notify_view_divider);
        this.mNotifyViewCancel = this.mNotifyView.findViewById(com.ss.android.article.browser.R.id.notify_view_cancel);
        this.mNotifyViewCancelLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mNotifyView != null) {
                    int notifyAction = getNotifyAction();
                    doHideNotify(notifyAction);
                    onClickNotifyCancel(notifyAction);
                }
            }
        });
        this.mNotifyViewText.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mNotifyView != null) {
                    int notifyAction = getNotifyAction();
                    doHideNotify(notifyAction);
                    onClickNotifyText(notifyAction);
                }
            }
        });
        this.mEmptyView = this.mRootView.findViewById(com.ss.android.article.browser.R.id.empty_load_view);
        this.mPullRefreshList = this.mRootView.findViewById(com.ss.android.article.browser.R.id.listview);
        this.mPullRefreshList.setScrollingWhileRefreshingEnabled(true);
        this.mListView = this.mPullRefreshList.getRefreshableView();
        this.mListView.setVerticalScrollBarEnabled(false);
        this.mListView.setScrollbarFadingEnabled(false);
        this.mListView.setOverScrollMode(2);
        this.mNotifyViewHelper = new NotifyViewHelper(this.mRootView.getContext());
        this.mListView.addHeaderView(this.mNotifyViewHelper.a());
        this.mPullRefreshList.setOnScrollListener(this);
        this.mPullRefreshList.setOnViewScrollListener(this);
        View v1_1 = layoutInflater.inflate(com.ss.android.article.browser.R.layout.f0, this.mListView, false);
        this.mFootLoading = v1_1.findViewById(com.ss.android.article.browser.R.id.ss_text);
        this.mLoadMore = v1_1.findViewById(com.ss.android.article.browser.R.id.ss_more);
        this.mFooter = new Footer(this, v1_1.findViewById(com.ss.android.article.browser.R.id.ss_footer_content));
        this.mListView.addFooterView(v1_1, null, false);
        this.mFooter.hideFooterContent();
        if ((this.mListView instanceof PinnedHeaderListView)) {
            ((PinnedHeaderListView) this.mListView).setDrawPinnedHeader(false);
        }
    }

    protected void doShowNotify(int arg1, String arg2, int arg3, boolean arg4, long arg5, boolean arg7, int arg8) {
    }

    protected void enableLoadMoreTimeStamp(boolean arg3) {
        long v0 = arg3 ? System.currentTimeMillis() : 0;
        this.mLastLoadMoreTimestamp = v0;
    }

    void ensureUgcEventHelper() {
        if (this.mUgcEventHelper == null) {
            this.mUgcEventHelper = new UgcEventHelper(this.getActivity(), this.mCurrentCellRef, this.getCategoryName(), this.getConcernId(), this.mReferType);
        }

        this.mUgcEventHelper.mCellRef = this.mCurrentCellRef;
    }

    protected void futureResolveData(List arg1) {
    }

    private String getCategoryName(String arg3) {
        String v0 = null;
        if (arg3 != null) {
            if (arg3.equals("click_headline")) {
                v0 = "__all__";
            } else if (arg3.startsWith("click_")) {
                v0 = arg3.replaceFirst("click_", "");
            }
        }

        return v0;
    }

    public String getCategoryName() {
        return null;
    }

    protected long getConcernId() {
        return 0;
    }

    protected List getData() {
        return this.mData;
    }

    protected String getGoDetailLabel() {
        return null;
    }

    public abstract String getListCategory();

    protected ListData getListData() {
        return this.mListData;
    }

    public abstract int getListType();

    protected int getNotifyAction() {
        int v0_1;
        if (this.mNotifyView != null) {
            Object v0 = this.mNotifyView.getTag();
            if ((v0 instanceof Integer)) {
                v0_1 = ((Integer) v0).intValue();
            } else {
                return 0;
            }
        } else {
            label_9:
            v0_1 = 0;
        }

        return v0_1;
    }

    public boolean getRemoveDislikedItem() {
        return true;
    }

    public String getSuffixLabel() {
        return null;
    }

    public abstract int getViewLayout();

    protected void handleAdClick(Context arg12, com.ss.android.article.base.feature.model.i arg13) {
        String v6 = null;
        if (arg13 != null) {
            AdsAppItem.a(arg12, v6, v6, v6, 0, new AdsAppItem.b(this.mContext, "embeded_ad", "click", 0, v6, 2));
        }
    }

    private void handleCancelDislike() {
        int v0_1;
        Object v0;
        int v1;
        int v11 = 10;
        CellRef v10 = this.mLastDislikedItem;
        this.mLastDislikedItem = null;
        if (v10 != null && this.getData() != null && this.mAdapter != null) {
            if (v10.cellType == 0) {
                Article v3 = v10.article;
                if (v3 == null) {
                    return;
                } else if (v3.userDislike) {
                    Iterator v4 = this.getData().iterator();
                    v1 = 0;
                    while (v4.hasNext()) {
                        v0 = v4.next();
                        if (((CellRef) v0).cateBehotTime < v10.cateBehotTime) {
                            break;
                        }

                        if (v0 != v10) {
                            if (((CellRef) v0).article != null && v3 != null && ((CellRef) v0).article.groupId == v10.article.groupId) {
                                return;
                            }

                            ++v1;
                            continue;
                        } else {
                            return;
                        }
                    }

                    if (v1 > this.getData().size()) {
                        return;
                    }

                    v3.userDislike = false;
                    this.mActionHelper.a(v11, v3, v10.adId);
                    v0_1 = v1;
                } else {
                    return;
                }
            } else {
                Iterator v3_1 = this.getData().iterator();
                v1 = 0;
                while (v3_1.hasNext()) {
                    v0 = v3_1.next();
                    if (((CellRef) v0).cateBehotTime < v10.cateBehotTime) {
                        break;
                    }

                    if ((((CellRef) v0)) != v10) {
                        ++v1;
                        continue;
                    } else {
                        return;
                    }
                }

                if (v1 > this.getData().size()) {
                    return;
                }

                v10.ab = false;
                v0_1 = v1;
            }

            if (v10.cellType == v11) {
                MobAdClickCombiner.onAdEvent(this.mContext, "feed_download_ad", "undislike", v10.downloadAppAd.id, v10.downloadAppAd.logExtra);
            } else if (v10.cellType == 16 && v10.feedCallAppAd != null) {
                MobAdClickCombiner.onAdEvent(this.mContext, "feed_call", "undislike", v10.feedCallAppAd.id, ((long) v10.feedCallAppAd.actionType), v10.feedCallAppAd.logExtra, 2);
            }

            this.getData().add(v0_1, v10);
            this.refreshList();
        }
    }

    public void handleCommentClick(int arg4, View arg5) {
        this.handleItemClick(arg4, arg5, new Object[]{Boolean.valueOf(true)});
    }

    public void handleItemClick(int arg7, View arg8, Object[] arg9) {
        Exception v1_1;
        Bundle bundle;
        boolean v3;
        boolean v2 = false;
        if (this.mLastClickItemIndex != arg7) {
            Bundle v1 = null;
            if (arg9 != null && arg9.length > 0) {
                try {
                    v3 = ((Boolean) arg9[0]).booleanValue();
                    if (arg9.length > 1) {
                        v2 = ((Boolean) arg9[1]).booleanValue();
                    }

                    bundle = new Bundle();
                    bundle.putBoolean("ViewComments", v3);
                    bundle.putBoolean("ShowWriteCommentDialog", v2);
                } catch (Exception v0) {
                    Exception v5 = v0;
                    bundle = v1;
                    v1_1 = v5;
                    Logger.throwExceptionInDebug(((Throwable) v1_1));
                }
            } else {
                bundle = v1;
            }
            this.handleItemClick(arg7, arg8, bundle);
        }
    }

    public void handleItemClick(int index, View arg18, Bundle bundle) {
        UrlBuilder v2_6;
        String v5;
        JSONObject v10;
        FeedCallAppAd v2_1;
        boolean v14;
        boolean v13;
        if (this.mLastClickItemIndex != index) {
            this.mLastClickItemIndex = index;
            if (bundle != null) {
                boolean v3 = bundle.getBoolean("ViewComments");
                v13 = bundle.getBoolean("ShowWriteCommentDialog");
                v14 = v3;
            } else {
                v13 = false;
                v14 = false;
            }

            if (this.mAdapter == null) {
                return;
            }

            this.checkAdGroupClick(index, v14);
            Object v2 = this.mAdapter.a(index);
            if (!(v2 instanceof CellRef)) {
                return;
            }

            Object v12 = v2;
            if (((CellRef) v12).getAdId() > 0) {
                ((CellRef) v12).expireSeconds = 0;
                ((CellRef) v12).adHasExpire = false;
            }

            if (((CellRef) v12).cellType == 1) {
                this.handleAdClick(this.mContext, null);
                return;
            }

            if (((CellRef) v12).cellType == 16) {
                v2_1 = ((CellRef) v12).feedCallAppAd;
                if (v2_1 == null) {
                    return;
                }

                v10 = new JSONObject();
                try {
                    if (!android.support.design.a.isTextEmpty(v2_1.logExtra)) {
                        v10.put("log_extra", v2_1.logExtra);
                    }

                    MobAdClickCombiner.onAdEvent(this.mContext, "embeded_ad", "click", v2_1.id, 1, v10, 2);
                } catch (Exception v3_1) {
                }

                if (v2_1.actionType == 1) {
                    MobAdClickCombiner.onAdEvent(this.mContext, "feed_call", "card_show", v2_1.id, ((long) v2_1.actionType), v10, 2);
                }

                this.openDetailPage(this.mContext, v2_1);
                return;
            }

            if (((CellRef) v12).cellType == 0 && ((CellRef) v12).Q == 3) {
                v2_1 = ((CellRef) v12).feedCallAppAd;
                if (v2_1 == null) {
//                    goto label_104;
                } else {
                    if (!v2_1.isValid()) {
//                    goto label_104;
                    } else {
                        JSONObject v3_2 = new JSONObject();
                        try {
                            if (android.support.design.a.isTextEmpty(v2_1.logExtra)) {
//                        goto label_104;
                            } else {
                                v3_2.put("log_extra", v2_1.logExtra);
                            }
                        } catch (Exception v2_2) {
                        }
                    }
                }
            }

            label_104:
            if (!((CellRef) v12).a()) {
                return;
            }

            Article v15 = ((CellRef) v12).article;
            if (v15 == null) {
                return;
            }

            if (((CellRef) v12).adId > 0) {
                AppUtil.b(((CellRef) v12).adClickTrackUrlList, this.mContext);
            }

            int v2_3 = !v15.hasArticleUrl() || (v15.groupFlags & 4) <= 0 ? 0 : 1;
            if (v2_3 != 0) {
                try {
                    v5 = this.getGoDetailLabel();
                    if (!AppData.getInstance().getAbSettings().isAppLogOld()) {
//                        goto label_140;
                    } else {

                        v10 = new JSONObject();
                        try {
                            v10.put("item_id", v15.itemId);
                            v10.put("aggr_type", v15.aggrType);
                        } catch (JSONException v2_4) {
                        }
                        MobClickCombiner.onEvent(this.getActivity(), "go_detail", v5, v15.groupId, ((CellRef) v12).adId, v10);
                    }
                    label_140:
                    if (AppData.getInstance().getAbSettings().isAppLogNew()) {
                        this.sendEventV3("go_detail", v15, ((CellRef) v12));
                    }

                    Intent v2_5 = new Intent(this.mContext, BrowserActivity.class);
                    v2_5.putExtra("use_swipe", true);
                    v2_5.putExtra("show_toolbar", true);
                    v2_5.putExtra("ad_id", ((CellRef) v12).adId);
                    v2_5.setData(Uri.parse(v15.articleUrl));
                    if (!android.support.design.a.isTextEmpty(v15.source)) {
                        v2_5.putExtra("title", v15.source);
                    }

                    this.startActivity(v2_5);
                } catch (Exception v2_2) {
                    label_180:
                    Logger.w("ArticleListFragment", "open article for natant_level=4 exception: " + v2_2);
                }

                return;
            }

            v2_3 = (v15.groupFlags & 262144) <= 0 || v15.articleType != 0 ? 0 : 1;
            if (v2_3 != 0 && (android.support.design.a.isTextEmpty(v15.openUrl))) {
                v2_6 = new UrlBuilder("sslocal://wenda_detail");
                v2_6.addParam("groupid", v15.groupId);
                v2_6.addParam("group_flags", 262144);
                v15.openUrl = v2_6.build();
            }

            v10 = new JSONObject();
            try {
                if (android.support.design.a.isTextEmpty(((CellRef) v12).logExtra)) {
//                    goto label_214;
                } else {
                    v10.put("log_extra", ((CellRef) v12).logExtra);
                }
            } catch (Exception v2_2) {
            }

            label_214:
            if (!android.support.design.a.isTextEmpty(v15.openUrl)) {
                if (this.canCallSDKSuccess(((CellRef) v12))) {
                    return;
                }

                v2_6 = new UrlBuilder(v15.openUrl);
                v2_6.addParam("enterfrom_answerid", v15.groupId);
                v15.openUrl = v2_6.build();
                String v2_7 = AdsAppBaseActivity.b(v15.openUrl);
                try {
                    String v3_3 = this.getSuffixLabel();
                    if (!android.support.design.a.isTextEmpty(v3_3)) {
                        v2_7 = android.support.design.a.e(v2_7, v3_3);
                    }

                    if (v2_7.contains("__back_url__")) {
                        UrlBuilder v3_4 = new UrlBuilder(com.ss.android.b.aa.a);
                        v3_4.addParam("adId", ((CellRef) v12).adId);
                        v3_4.addParam("log_extra", ((CellRef) v12).logExtra);
                        v2_7 = v2_7.replace("__back_url__", URLEncoder.encode(v3_4.build(), "UTF-8"));
                    }

                    if (AppUtil.b(this.getActivity(), v2_7)) {
                        MobClickCombiner.onEvent(this.mContext, "embeded_ad", "open_url_success", ((CellRef) v12).adId, 1, v10);
                        if (((CellRef) v12).adId <= 0) {
                            return;
                        }

                        MobAdClickCombiner.onAdEvent(this.mContext, "embeded_ad", "open_url_app", ((CellRef) v12).adId, 1, v10, 2);
                        return;
                    }

                    if (((CellRef) v12).adId <= 0) {
//                        goto label_285;
                    } else {
                        MobAdClickCombiner.onAdEvent(this.mContext, "embeded_ad", "open_url_h5", ((CellRef) v12).adId, 1, v10, 2);
                    }
                } catch (Exception v2_2) {
                    Logger.w("ArticleListFragment", "open article with open_url " + v15.openUrl + " " + v2_2);
                }

                label_285:
                MobClickCombiner.onEvent(this.mContext, "embeded_ad", "open_url_fail", ((CellRef) v12).adId, 1, v10);
//                goto label_292;
            } else {
                if (((CellRef) v12).adId > 0) {
                    MobClickCombiner.onEvent(this.mContext, "embeded_ad", "open_url_h5", ((CellRef) v12).adId, 1, v10);
                }
            }

//            label_292:
            boolean v6 = v15.getCommentMode() != 0 ? false : v14;
            this.doHandleItemClick(index, (CellRef) v12, arg18, v6, v13);
        }
    }

    public void handleMoreActionClick(int position, View arg10, Object[] arg11) {
        if (this.mAdapter != null && this.mFeedActionDialogManager != null) {
            Object v1 = null;
            Object v0 = this.mAdapter.b(position);
            if ((v0 instanceof CellRef)) {
                v1 = v0;
            }

            if (v1 == null) {
                return;
            }

            List v0_1 = ((CellRef) v1).actionList;
            if (v0_1 == null) {
                return;
            }

            if (v0_1.size() == 0) {
                return;
            }

            this.mPendingItem = ((CellRef) v1);
            this.mCurrentCellRef = ((CellRef) v1);
            this.mClickedPopIcon = arg10;
            int[] v0_2 = new int[2];
            arg10.getLocationOnScreen(v0_2);
            this.mFeedActionDialogManager.a = UIUtils.getScreenWidth(this.getActivity()) - arg10.getWidth() - v0_2[0];
            FeedActionDialogManager v2 = this.mFeedActionDialogManager;
            FragmentActivity v3 = this.getActivity();
            SSCallback v4 = this.mMoreActionCallback;
            dd.WindowFocusChangeListener v5 = this.mWindowFocusChangeListener;
            if (v2.b != null && v2.b.get() != null) {
                v2.b.get().dismiss();
            }

            ai v6 = new ai(v3, ((CellRef) v1), v4);
            v6.g = v5;
            int v1_1 = v2.a;
            if (v6.mTopArrow != null && ((v6.mTopArrow.getLayoutParams() instanceof ViewGroup.MarginLayoutParams))) {
                ((ViewGroup.MarginLayoutParams) v6.mTopArrow.getLayoutParams()).setMargins(0, 0, v1_1, 0);
            }

            if (v6.mBottomArrow != null && ((v6.mBottomArrow.getLayoutParams() instanceof ViewGroup.MarginLayoutParams))) {
                ((ViewGroup.MarginLayoutParams) v6.mBottomArrow.getLayoutParams()).setMargins(0, 0, v1_1, 0);
            }

            v2.b = new WeakReference(v6);
            v6.show();
            this.mHandler.removeCallbacks(this.mHideNotifyTask);
            this.ensureUgcEventHelper();
            this.mUgcEventHelper.reportEvent("click_more");
        }
    }

    public void handleMsg(Message message) {

    }

    public void handlePopIconClick(int arg9, View arg10, int arg11) {
        long v4 = 0;
        if (this.mAdapter != null && this.dislikeDialogManager != null) {
            Object v1 = null;
            Object v0 = this.mAdapter.b(arg9);
            if ((v0 instanceof CellRef)) {
                v1 = v0;
            }

            if (v1 == null) {
                return;
            }

            this.mPendingItem = ((CellRef) v1);
            this.mPendingIndex = arg9;
            switch (arg11) {
                case 0: {
                    Article v0_1 = ((CellRef) v1).article;
                    if (v0_1 == null) {
                        return;
                    }

                    if (((AbsArticle) v0_1).groupId > v4) {
                        break;
                    }
                    return;
                }
                case 1:
                case 9:
                case 10:
                case 16:
                case 30: {
                    if (v1 == null) {
                        return;
                    }

                    if (((CellRef) v1).adId <= v4) {
                        return;
                    }
                    break;
                }
                case 44: {
                    this.getData().remove(this.mPendingItem);
                    this.refreshList();
                    return;
                }
            }
            this.mClickedPopIcon = arg10;
            int v0_2 = ((CellRef) v1).filterWordList.size() == 0 ? 1 : 0;
            if (v0_2 == 0 && this.dislikeDialogManager != null) {
                m v2 = this.dislikeDialogManager;
                FragmentActivity v3 = this.getActivity();
                boolean v4_1 = this.mIsNightMode;
                dd.WindowFocusChangeListener v5 = this.mWindowFocusChangeListener;
                com.ss.android.article.base.feature.feed.dd.a v6 = this.dislikeBtnClickListener;
                String v7 = this.getCategoryName();
                if (arg10 != null && v1 != null && v3 != null && v5 != null && v6 != null) {
                    if (v2.b != null && v2.b.get() != null) {
                        v2.b.get().dismiss();
                    }

                    arg10.getId();
                    DislikeDialog v0_3 = new DislikeDialog(((Activity) v3), ((CellRef) v1), v7);
                    v0_3.b(v4_1);
                    v0_3.a = v5;
                    v0_3.b = v6;
                    v2.b = new WeakReference(v0_3);
                    v0_3.show();
                }

                this.mHandler.removeCallbacks(this.mHideNotifyTask);
                return;
            }

            this.showDislikePopWindow(arg10);
        }
    }

    public boolean hasSendAction(int arg4, CellRef arg5) {
        boolean v0_2;
        if (this.mActionSendRecoder != null) {
            ActionSendRecoder v0 = this.mActionSendRecoder;
            if (v0.a != null) {
                Object v0_1 = v0.a.get(arg4);
                if (v0_1 != null) {
                    v0_1 = ((HashMap) v0_1).get(arg5);
                    if (v0_1 != null) {
                        v0_2 = ((Boolean) v0_1).booleanValue();
                        return v0_2;
                    }
                }
            }

            v0_2 = false;
        } else {
            v0_2 = false;
        }

        return v0_2;
    }

    public void hideNoDataView() {
        UIUtils.setVisibility(this.mNoDataView, 8);
    }

    public void hideNoNetView() {
        if (this.mNoNetView != null) {
            this.mNoNetView.setVisibility(View.GONE);
        }
    }

    public boolean isPrimaryPage() {
        return true;
    }

    public void notifyDataSetChanged() {
        this.mAdapter.notifyDataSetChanged();
    }

    public void onActivityCreated(Bundle arg1) {
        this.superOnActivityCreated(arg1);
        this.doOnActivityCreated();
    }

    public void onActivityResult(int arg2, int arg3, Intent arg4) {
        if (this.isViewValid()) {
            super.onActivityResult(arg2, arg3, arg4);
        }
    }

    public void onAdDeleted(long arg10) {
        int v0_1 = 0;
        long v6 = 0;
        if (arg10 > v6 && this.getData() != null && !this.getData().isEmpty()) {
            Iterator v3 = this.getData().iterator();
            int v1;
            for (v1 = 0; v3.hasNext(); v1 = v0_1) {
                Object v0 = v3.next();
                if (v0 == null) {
                    continue;
                }

                if (((CellRef) v0).getAdId() <= v6) {
                    continue;
                }

                if (((CellRef) v0).getAdId() == arg10) {
                    v3.remove();
                    this.mAppData.a(((CellRef) v0));
                    v0_1 = 1;
                } else {
                    v0_1 = v1;
                }
            }

            if (this.mAdapter == null) {
                return;
            }

            if (v1 == 0) {
                return;
            }

            if (!this.isActive()) {
                return;
            }

            this.refreshList(this.mListData.b, true);
        }
    }

    protected void onCategoryEvent(String arg2) {
        this.onCategoryEvent(arg2, true);
    }

    protected void onCategoryEvent(String arg1, boolean arg2) {
        this.onEvent(arg1);
    }

    protected void onClickNotifyCancel(int arg2) {
        if (this.isViewValid()) {
            if (arg2 != 2) {
            } else {
                this.handleCancelDislike();
            }
        }
    }

    protected void onClickNotifyText(int arg9) {
        if (this.isViewValid()) {
            FragmentActivity v1 = this.getActivity();
            if (arg9 != 1) {
            } else {
                if (v1 != null && this.mAdsAppItem != null) {
                    if (!AppUtil.c(((Context) v1), this.mAdsAppItem.openUrl, this.mAdsAppItem.packageName)) {
                        this.mAdsAppItem.a(((Context) v1));
                    }

                    MobClickCombiner.onEvent(((Context) v1), "notify", "tips_click", this.mAdsAppItem.id, 0);
                }

                this.mAdsAppItem = null;
            }
        }
    }

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
        this.mAppData = AppData.getInstance();
        return ArticleListFragment.wrap(inflater.inflate(this.getViewLayout(), container, false));
    }

    public void onDayNightThemeChanged(Resources resources, boolean isNightMode) {
        if (this.mNotifyDivider != null) {
            UIUtils.setBackgroundColor(this.mNotifyDivider, resources, R.color.notify_view_divider);
        }

        UIUtils.setBackgroundColor(this.mNotifyView, resources, R.color.o3);
        this.mNotifyViewText.setTextColor(resources.getColor(com.ss.android.article.browser.R.color.o1));
        this.mNotifyViewCancel.setBackgroundResource(com.ss.android.article.browser.R.drawable.t8);
        this.mFootLoading.setTextColor(resources.getColor(com.ss.android.article.browser.R.color.lu));
        this.mPullRefreshList.getLoadingLayoutProxy().setTextColor(resources.getColor(com.ss.android.article.browser.R.color.ssxinzi3));
        this.mPullRefreshList.getLoadingLayoutProxy().setTheme(isNightMode);
        if (this.mNoNetView != null) {
            this.mNoNetView.initNoDataActionBtn();
        }

        if (this.mNoDataView != null) {
            this.mNoDataView.initNoDataActionBtn();
        }
    }

    public void onDestroy() {
        if (this.mPopupToast != null) {
            this.mPopupToast.onDestroy();
        }

        if (this.mNetworkMonitor != null) {
            this.mNetworkMonitor.onDestroy();
        }

        this.mShareDialog = null;
        this.mShareHelper = null;
        if (this.mCmdHandler != null) {
            this.mCmdHandler.a.remove(this);
        }

        if (this.dislikeDialogManager != null) {
            m v0 = this.dislikeDialogManager;
            m.a = null;
            v0.b = null;
        }

        if (this.mFeedActionDialogManager != null) {
            FeedActionDialogManager.c = null;
        }

        this.mHandler.removeCallbacksAndMessages(null);
        if (this.mNotifyViewHelper != null) {
            this.mNotifyViewHelper.d();
        }

        super.onDestroy();
    }

    public void onDislikeClick(boolean arg14) {
        int v0_3;
        BaseArticle v0_2 = null;
        boolean v1_1;
        boolean v0;
        if (this.mPendingItem != null) {
            this.onVideoDislike();
            int v11 = this.mPendingItem.cellType;
            BaseArticle v10 = null;
            if (this.mCurrentCellRef != null) {
                this.mCurrentCellRef.r();
            }

            if (v11 == 0) {
                Article v1 = this.mPendingItem.article;
                if (v1 == null) {
                    return;
                }

                v0 = !((AbsArticle) v1).userDislike ? true : false;
                ((AbsArticle) v1).userDislike = v0;
                Article v12 = v1;
                v1_1 = ((AbsArticle) v1).userDislike;
                Article v0_1 = v12;
//                goto label_24;
            } else {
                if (v11 != 10 && v11 != 1 && v11 != 30 && v11 != 9 && v11 != 16) {
                    v1_1 = false;
                    v0_2 = v10;
//                goto label_24;
                } else {
                    CellRef v1_2 = this.mPendingItem;
                    v0 = !this.mPendingItem.ab ? true : false;
                    v1_2.ab = v0;
                    v0 = this.mPendingItem.ab;
                    long v4 = this.mPendingItem.adId;
                    this.onCategoryEvent("dislike_menu", false);
                    new DislikeActionReportThread(this.mContext, v4, "dislike").start();
                    JSONObject v8 = new JSONObject();
                    try {
                        v8.put("log_extra", this.mPendingItem.logExtra);
                    } catch (JSONException v1_3) {
                    }

                    MobAdClickCombiner.onAdEvent(this.mContext, "dislike", "confirm_with_reason", v4, 0, v8, 2);
                    if (v11 == 10) {
                        MobAdClickCombiner.onAdEvent(this.mContext, "feed_download_ad", "dislike", v4, 0, v8, 2);
                        v1_1 = v0;
                        v0_2 = v10;
//                goto label_24;
                    } else {
                        if (v11 == 16 && this.mPendingItem.feedCallAppAd != null) {
                            MobAdClickCombiner.onAdEvent(this.mContext, "feed_call", "dislike", v4, ((long) this.mPendingItem.feedCallAppAd.actionType), v8, 2);
                        }
                        v1_1 = v0;
                        v0_2 = v10;
                    }
                }
            }
//            label_24:
            this.sendDislikeAction();
            int v2 = 0;
            if (v1_1) {
                this.sendDislikeEvent(this.mPendingItem, v0_2);
                if (arg14) {
                    this.showDislikeNotify(this.mPendingItem);
                }

                v0_3 = 1;
                int v1_4 = this.mAdapter.mCellRefList.indexOf(this.mPendingItem);
                int v3 = this.mListView.getFirstVisiblePosition();
                int v4_1 = this.mListView.getLastVisiblePosition();
                if (v1_4 >= 0 && v1_4 >= v3 && v1_4 <= v4_1) {
                    v1_4 = v1_4 - v3 + this.mListView.getHeaderViewsCount();
                    if (v1_4 >= 0 && v1_4 < this.mListView.getChildCount()) {
                        v2 = 1;
                        v0_3 = 0;
                        View v1_5 = this.mListView.getChildAt(v1_4);
                        ValueAnimator v3_1 = ValueAnimator.ofInt(new int[]{v1_5.getHeight(), 1}).setDuration(200);
                        v3_1.addListener(new ar(v1_5, this.mOnRemoveAnmatorFinishListener));
                        v3_1.addUpdateListener(new as(v1_5));
                        v3_1.start();
                        this.mAdapter.mAnimatorHashMap.put(v1_5, v3_1);
                    }
                }

                v1_4 = v0_3;
                v0_3 = v2;
                if (v1_4 == 0) {
//                    goto label_88;
                } else {
                    this.mRefreshFromDislike = this.containsHasMoreRefreshCell();
                    this.getData().remove(this.mPendingItem);
                    this.refreshList();
                    v0_3 = 1;
                }
            } else {
                v0_3 = 0;
            }

            label_88:
            if (v0_3 == 0 && this.mAdapter != null) {
                this.mAdapter.notifyDataSetChanged();
            }

            DBHelper v0_4 = DBHelper.getInstance(this.mContext);
            if (v0_4 != null && (CellRef.isValidCellType(v11))) {
                v0_4.a(v11, this.mPendingItem.cellId, this.mPendingItem.category);
            }

            this.mPendingItem = null;
        }
    }

    public abstract void onEvent(String arg1);

    public abstract void onEvent(String arg1, BaseArticle arg2);

    protected void onFavorClick() {
        int v2;
        if (this.mPendingItem != null) {
            Article v3 = this.mPendingItem.article;
            long v4 = this.mPendingItem.adId;
            boolean v0 = !((AbsArticle) v3).userRepin ? true : false;
            ((AbsArticle) v3).userRepin = v0;
            if (((AbsArticle) v3).userRepin) {
                this.onCategoryEvent("favorite_menu", false);
            } else {
                this.onCategoryEvent("unfavorite_menu", false);
            }

            AppData.isNightMode();
            if (((AbsArticle) v3).userRepin) {
                ++((AbsArticle) v3).repinCount;
                v2 = 4;
                this.showToast(com.ss.android.article.browser.R.drawable.doneicon_popup_textpage, R.string.toast_favor);
            } else {
                --((AbsArticle) v3).repinCount;
                if (((AbsArticle) v3).repinCount < 0) {
                    ((AbsArticle) v3).repinCount = 0;
                }

                v2 = 5;
                this.showToast(0, R.string.toast_unfavor);
            }

            this.mAppData.a = System.currentTimeMillis();
            List v6 = this.mSpipe.b();
            if (((AbsArticle) v3).userRepin) {
                if ((this.mAppData.mShareWhenFavor) && !v6.isEmpty()) {
                    this.mActionHelper.a(v2, ((AbsArticle) v3), v4, v6);
//                    goto label_41;
                } else {

                    this.mActionHelper.a(v2, ((AbsArticle) v3), v4);
                    ShareHelper v0_1 = this.mShareHelper;
                    if (v3 == null) {
//                    goto label_41;
                    } else {

                        if (!((AbsArticle) v3).userRepin) {
//                    goto label_41;
                        } else {
                            if (v0_1.mBaseAppData.mShareWhenFavor) {
                                MobClickCombiner.onEvent(v0_1.mContext, "xiangping", "favorite_forward");
                                if (v0_1.mSpipe.h()) {
                                    v0_1.b(((AbsArticle) v3), v4);
//                        goto label_41;
                                } else {
                                    v0_1.a(((AbsArticle) v3), v4);
//                      goto label_41;
                                }
                            } else {
                                if (v0_1.mBaseAppData.mShareWhenFavorShowed) {
//                    goto label_41;
                                } else {
                                    BaseAppData v2_1 = v0_1.mBaseAppData;
                                    Context v6_1 = v0_1.mContext;
                                    ((MediaAppData) v2_1).mShareWhenFavorShowed = true;
                                    SharedPreferences.Editor v1 = v6_1.getSharedPreferences("app_setting", 0).edit();
                                    v1.putBoolean("share_when_favor_showed", ((MediaAppData) v2_1).mShareWhenFavorShowed);
                                    SharedPreferenceCompat.commit(v1);
                                    v0_1.a(((AbsArticle) v3), v4);
                                }
                            }
                        }
                    }
                }
            } else {
                this.mActionHelper.a(v2, ((AbsArticle) v3), v4);
            }

            label_41:
            if (this.mAdapter == null) {
                return;
            }

            this.mAdapter.notifyDataSetChanged();
        }
    }

    public void onGroupDeleted(AbsArticle arg9) {
        if (arg9 != null && arg9.groupId > 0 && this.getData() != null && !this.getData().isEmpty()) {
            Iterator v3 = this.getData().iterator();
            int v1;
            for (v1 = 0; v3.hasNext(); v1 = 1) {
                Object v0 = v3.next();
                if (v0 == null) {
                    continue;
                }

                if (((CellRef) v0).cellType != 0) {
                    continue;
                }

                Article v0_1 = ((CellRef) v0).article;
                if (v0_1 == null) {
                    continue;
                }

                if (v0_1.delete) {
                    continue;
                }

                if (v0_1.groupId != arg9.groupId) {
                    continue;
                }

                v0_1.delete = true;
            }

            if (this.mAdapter != null && v1 != 0 && (this.isActive())) {
                this.refreshList(this.mListData.b, true);
            }
        }
    }

    public void onGroupUpdate(AbsArticle arg11) {
        int v4 = 1;
        if (arg11 != null && ((arg11 instanceof Article))) {
            long v6 = ((Article) arg11).groupId;
            if (v6 > 0 && this.getData() != null && !this.getData().isEmpty()) {
                int v1 = 0;
                boolean v3 = false;
                while (v1 < this.getData().size()) {
                    Object v0 = this.getData().get(v1);
                    if (v0 != null && ((CellRef) v0).cellType == 0) {
                        Article v0_1 = ((CellRef) v0).article;
                        if (v0_1 != null) {
                            if (v0_1.groupId == v6) {
                                if ((((AbsArticle) v0_1)) != arg11) {
                                    v0_1.a(((Article) arg11));
                                } else {
                                }

                                if (v4 == 0 && !v3) {
                                    return;
                                }

                                if (!this.isActive()) {
                                    return;
                                }

                                this.refreshList(this.mListData.b, v3);
                                return;
                            } else if (v0_1.delete) {
                                v3 = true;
                            }
                        }
                    }

                    ++v1;
                }

                v4 = 0;
                label_30:
                if (v4 == 0 && !v3) {
                    return;
                }

                if (!this.isActive()) {
                    return;
                }

                this.refreshList(this.mListData.b, v3);
            }
        }
    }

    protected void onLoadMoreClick() {
        this.queryData();
    }

    public void onPanelDislike(long arg10, boolean arg12) {
        TempBean v4;
        Object v0;
        long v6 = 0;
        if ((this.isViewValid()) && arg10 > v6 && this.getData() != null && !this.getData().isEmpty()) {
            this.mPendingItem = null;
            Iterator v3 = this.getData().iterator();
            int v0_1;
            do {
                if (v3.hasNext()) {
                    v0 = v3.next();
                    if (v0 == null) {
                        continue;
                    }

                    if (!((CellRef) v0).e()) {
                        continue;
                    }

                    if (((CellRef) v0).ab) {
                        continue;
                    }

                    v4 = ((CellRef) v0).af;
                    if (v4 == null) {
                        continue;
                    }

                    if (v4.l) {
                        continue;
                    }

                    if (v6 != arg10) {
                        continue;
                    }
                    v4.l = true;
                    ((CellRef) v0).ab = true;
                    this.mPendingItem = ((CellRef) v0);
                    v0_1 = 1;
                    break;
                } else {
                    v0_1 = 0;
                    break;
                }
            } while (true);
            if (this.mAdapter == null) {
                return;
            }

            if (v0_1 == 0) {
                return;
            }

            this.onDislikeClick(arg12);
        }
    }

    public void onPanelRefresh(long arg10) {
        long v6 = 0;
        if ((this.isViewValid()) && arg10 > v6 && this.getData() != null && !this.getData().isEmpty()) {
            Iterator v3 = this.getData().iterator();
            int v1;
            for (v1 = 0; v3.hasNext(); v1 = 1) {
                Object v0 = v3.next();
                if (v0 == null) {
                    continue;
                }

                if (!((CellRef) v0).e()) {
                    continue;
                }

                if (((CellRef) v0).ab) {
                    continue;
                }

                TempBean v0_1 = ((CellRef) v0).af;
                if (v0_1 == null) {
                    continue;
                }

                if (v0_1.l) {
                    continue;
                }

                if (v6 != arg10) {
                    continue;
                }
            }

            if (this.mAdapter != null && v1 != 0 && (this.isActive())) {
                this.refreshList(this.mListData.b, true);
            }
        }
    }

    public void onResume() {
        this.mLastClickItemIndex = -1;
        if (this.mNetworkMonitor != null) {
            this.mNetworkMonitor.registerNetworkStateReceiver();
        }

        super.onResume();
        this.tryRefreshTheme();
    }

    public void onScroll(AbsListView arg1, int arg2, int arg3, int arg4) {
    }

    public void onScrollStateChanged(AbsListView arg2, int arg3) {
        this.mLastScrollState = arg3;
        if (arg3 != 0 && this.mNotifyView != null && this.mNotifyViewCancelLayout != null && this.mNotifyView.getVisibility() == View.VISIBLE && this.mNotifyViewCancelLayout.getVisibility() != View.VISIBLE) {
            this.mHideNotifyTask.run();
        }
    }

    public void onStop() {
        int v3 = 8;
        super.onStop();
        if (this.mNoNetView != null) {
            this.mNoNetView.b();
        }

        if (this.mNotifyViewHelper != null) {
            UIUtils.setLayoutParams(this.mNotifyViewHelper.a(), -3, 0);
            UIUtils.setVisibility(this.mNotifyView, v3);
            UIUtils.setVisibility(this.mNotifyViewHelper.a(), v3);
        }
    }

    protected void onVideoDislike() {
    }

    public void onViewCreated(View view, Bundle bundle) {
        this.superOnViewCreated(view, bundle);
        this.doOnViewCreated(view);
    }

    public void onViewScrollChanged(int arg3, int arg4, int arg5, int arg6) {
        if (this.mNotifyViewHelper != null) {
            this.mNotifyViewHelper.a(this.mPullRefreshList, arg4, arg6);
        }
    }

    public void openDetailPage(Context arg6, FeedCallAppAd arg7) {
        if (arg6 != null && arg7 != null && (TTUtils.isValidUrl(arg7.webUrl))) {
            Intent v0 = new Intent(arg6, BrowserActivity.class);
            v0.setData(Uri.parse(arg7.webUrl));
            if (!android.support.design.a.isTextEmpty(arg7.webTitle)) {
                v0.putExtra("title", arg7.webTitle);
            }

            if (AppData.getInstance().allowInsideDownloadManager()) {
                v0.putExtra("bundle_is_from_app_ad", true);
                v0.putExtra("bundle_app_ad_from", 1);
                v0.putExtra("bundle_download_url", arg7.downloadUrl);
                v0.putExtra("bundle_download_app_name", arg7.appName);
                v0.putExtra("bundle_download_app_extra", String.valueOf(arg7.id));
                v0.putExtra("bundle_download_app_log_extra", arg7.logExtra);
            }

            v0.putExtra("use_swipe", true);
            arg6.startActivity(v0);
        }
    }

    public abstract void queryData();

    public final int refreshList() {
        return this.refreshList(-1, true);
    }

    public final int refreshList(int arg15, boolean arg16) {
        int v0_1 = 0;
        if (this.getData() != null) {
            if (!arg16) {
                this.setItemViewReuseTag();
            }

            Object v0 = null;
            Object v1 = arg15 < 0 || arg15 >= this.getData().size() ? v0 : this.getData().get(arg15);
            boolean v5 = this.getRemoveDislikedItem();
            Iterator v6 = this.getData().iterator();
            int v2;
            for (v2 = 0; v6.hasNext(); v2 = v0_1) {
                v0 = v6.next();
                if (v0 == null) {
                    continue;
                }

                int v3 = 0;
                if (((CellRef) v0).cellType != 0) {
                    if (((CellRef) v0).cellType == 10) {
                        if (((CellRef) v0).ab) {
                            v6.remove();
                            v3 = 1;
//                            goto label_38;
                        } else {
                            DownloadAppAd v4 = ((CellRef) v0).downloadAppAd;
                            if (v4 == null) {
//                            goto label_38;
                            } else {
                                if (!v4.a(this.mContext)) {
//                            goto label_38;
                                } else {
                                    v6.remove();
                                    v3 = 1;
//                        goto label_38;
                                }
                            }
                        }
                    } else {
                        if (((CellRef) v0).cellType != 1 && ((CellRef) v0).cellType != 9 && ((CellRef) v0).cellType != 16 && ((CellRef) v0).cellType != 30) {
//                        goto label_38;
                        } else {
                            if (!((CellRef) v0).ab) {
//                        goto label_38;
                            } else {
                                v6.remove();
                                v3 = 1;
                            }
                        }
                    }
                } else if ((((CellRef) v0).a()) && ((CellRef) v0).article != null) {
                    if (!((CellRef) v0).article.delete) {
                        if (!v5) {
                        } else if (((CellRef) v0).article.userDislike) {
                            v6.remove();
                            v3 = 1;
                        }
                    } else {
                        label_36:
                        v6.remove();
                        v3 = 1;
                    }
                }

//                label_38:
                boolean v4_1 = ((CellRef) v0).getAdId() <= 0 || ((CellRef) v0).expireSeconds <= 0 || ((CellRef) v0).adFetchTime < 0 || ((CellRef) v0).adFetchTime + ((CellRef) v0).expireSeconds >= System.currentTimeMillis() / 1000 ? false : true;
                ((CellRef) v0).adHasExpire = v4_1;
                if (v3 == 0 && (((CellRef) v0).adHasExpire)) {
                    v6.remove();
                    v3 = 1;
                    this.mAppData.a(((CellRef) v0));
                }

                v0_1 = v2 != 0 || v3 == 0 ? v2 : 1;
            }

            if (v2 != 0 && v1 != null) {
                v0_1 = this.getData().indexOf(v1);
                if (v0_1 >= 0) {
                    arg15 = v0_1;
                }
            }

            if (this.mAdapter != null) {
                this.futureResolveData(this.getData());
                if (1 != 0) {
                    this.mAdapter.b(this.getData());
                } else {
                    this.mAdapter.notifyDataSetChanged();
                }
            }

            this.refreshListHook();
            this.mRefreshFromDislike = false;
            if (this.mEmptyView != null && this.mEmptyView.getVisibility() == View.VISIBLE && this.getData().size() > 0) {
                this.mEmptyView.setVisibility(View.GONE);
            }

            if ((this.getData().isEmpty()) && !NetworkUtils.isNetworkAvailable(this.getActivity())) {
                this.showNoNetView();
                return arg15;
            }

            this.hideNoNetView();
        }

        return arg15;
    }

    protected final int refreshList(int arg2) {
        return this.refreshList(arg2, true);
    }

    public abstract void refreshListHook();

    private void sendDislikeAction() {
        Article v2_5 = null;
        boolean v2_3;
        String v10_1;
        int v9;
        if (this.mPendingItem == null) {
            return;
        }

        if (!CellRef.b(this.mPendingItem.cellType)) {
            return;
        }

        String v11 = "dislike";
        CellRef v4 = this.mPendingItem;
        long v2 = 0;

        long v4_1;
        switch (v4.cellType) {
            case 0:
//                goto label_106;
                v2 = v4.article != null ? v4.article.groupId : 0;
                v4_1 = v2;
                break;
            case 1: {
//                goto label_104;
                v2 = 0;
                v4_1 = v2;
                break;
            }
            case 9:
            case 10:
            case 16: {
//                goto label_101;
                v2 = v4.adId;
                v4_1 = v2;
                break;

            }
            case 25: {
//                goto label_114;
                v2 = 0;
                v4_1 = v2;
                break;
            }
            default:
                v4_1 = v2;
                break;

        }

        long v6 = 0;
        int v8 = 0;
        if (this.mPendingItem.a()) {
            v6 = this.mPendingItem.article.itemId;
            v8 = this.mPendingItem.article.aggrType;
        }

        CellRef v3 = this.mPendingItem;
        switch (v3.cellType) {
            case 0: {
                if (v3.adId <= 0) {
                    v9 = 1;
                    break;
                }

                v9 = 3;
                break;
            }
            case 25: {
                v9 = 7;
                break;
            }
            case 1:
            case 9:
            case 10:
            case 30: {
                v9 = 3;
                break;
            }
            case 32: {
                v9 = 8;
                break;
            }
            default: {
                label_35:
                v9 = 1;
                break;
            }
        }

        long v12 = System.currentTimeMillis();
        JSONObject v3_1 = new JSONObject();
        try {
            v3_1.put("extra", this.mPendingItem.actionExtra);
            JSONArray v10 = new JSONArray();
            Iterator v14 = this.mPendingItem.filterWordList.iterator();
            while (v14.hasNext()) {
                Object v2_2 = v14.next();
                if (!((FilterWord) v2_2).c) {
                    continue;
                }

                v10.put(((FilterWord) v2_2).a);
            }

            v3_1.put("filter_words", v10);
            if (v9 != 3) {
//                goto label_68;
            } else {
                v3_1.put("ad_id", this.mPendingItem.getAdId());
                v10_1 = "clicked";
                if (this.mPendingItem.readTs > 0) {
                    v2_3 = true;
                } else {
                    v2_3 = false;
                }
                v3_1.put(v10_1, v2_3);
                v3_1.put("log_extra", this.mPendingItem.logExtra);
            }
        } catch (JSONException v2_1) {
            label_59:
            v2_1.printStackTrace();
            Logger.e("ArticleListFragment", "exception in sendDislikeAction : " + v2_1.toString());
        }

//        label_68:
        ItemActionV3 v14_1 = new ItemActionV3(v11, new BaseArticle(v4_1, v6, v8), v9, v12, v3_1.toString());
        BatchActionHelper v3_2 = this.batchActionHelper;
        v4 = this.mPendingItem;
        AbsArticle v2_4 = null;
        switch (v4.cellType) {
            case 0: {
                v2_5 = v4.article;
                break;
            }
        }

        if (v14_1.a()) {
            com.ss.android.action.bb.a();
            com.ss.android.action.bb.a(v14_1, v2_5);
            if (v3_2.b == null) {
                return;
            }

            if (!NetworkUtils.isNetworkAvailable(v3_2.b)) {
                return;
            }

            new ActionThreadV3(v3_2.b, v3_2.a, v14_1).start();
        }
    }

    private void sendDislikeEvent(CellRef arg10, BaseArticle arg11) {
        if (arg10 != null && arg11 != null) {
            String v3 = "";
            JSONObject v8 = new JSONObject();
            try {
                v8.put("category_name", this.getCategoryName());
                v8.put("itemId", arg11.itemId);
                v8.put("aggrType", arg11.aggrType);
                JSONArray v1 = new JSONArray();
                Iterator v2 = this.mPendingItem.filterWordList.iterator();
                while (v2.hasNext()) {
                    Object v0_1 = v2.next();
                    if (!((FilterWord) v0_1).c) {
                        continue;
                    }

                    v1.put(((FilterWord) v0_1).a);
                }

                v8.put("filter_words", v1);
                v3 = v1.length() == 0 ? "confirm_no_reason" : "confirm_with_reason";
                if (android.support.design.a.isTextEmpty(arg10.logExtra)) {
//                    goto label_32;
                } else {
                    v8.put("log_extra", arg10.logExtra);
                }
            } catch (Exception v0) {
                v0.printStackTrace();
            }

            label_32:
            MobClickCombiner.onEvent(this.mContext, "dislike", v3, arg11.groupId, 0, v8);
            if (this.mCurrentCellRef == null) {
                return;
            }

            this.mCurrentCellRef.r();
        }
    }


    public void sendEventV3(String arg11, Article arg12, CellRef arg13) {
        if (arg12 != null && arg13 != null) {
            String v2 = this.getGoDetailLabel();
            String v3 = this.getCategoryName(v2);
            int v0 = v2 == null || !v2.startsWith("click_") || (v2.equals("click_headline")) ? 0 : 1;
            JSONObjectWrapper v4 = new JSONObjectWrapper();
            v4.put("group_id", Long.valueOf(arg12.groupId)).put("item_id", Long.valueOf(arg12.itemId)).put("ad_id", Long.valueOf(arg13.adId)).put("aggr_type", Integer.valueOf(arg12.aggrType)).put("log_pb", arg13.logPb);
            String v0_1 = v0 != 0 ? "click_category" : v2;
            v4.put("enter_from", v0_1).put("category_name", v3);
            if (AppData.getInstance().getAbSettings().isApplogStaging()) {
                v4.put("_staging_flag", Integer.valueOf(1));
            }

            android.support.design.a.onEvent(arg11, v4.jo);
        }
    }

    public void setItemViewReuseTag() {
        if (this.mListView != null) {
            int v1 = this.mListView.getChildCount();
            int v0;
            for (v0 = 0; v0 < v1; ++v0) {
                this.mListView.getChildAt(v0).setTag(com.ss.android.article.browser.R.id.item_reuse_tag, Boolean.TRUE);
            }
        }
    }

    public void setSelectionFromTop(int arg4) {
        if (this.mAdapter != null && arg4 >= 0 && arg4 < this.getData().size()) {
            int v0 = this.mListView.getHeaderViewsCount() + arg4;
            int v1 = this.mListView.getFirstVisiblePosition();
            int v2 = this.mListView.getLastVisiblePosition();
            if (v0 >= v1) {
                if (v0 <= v2) {
                } else if (v0 < this.mListView.getCount()) {
                    this.mListView.setSelectionFromTop(v0, this.mSectionHeight);
                    return;
                }
                return;
            }

            label_19:
            this.mListView.setSelectionFromTop(v0, this.mSectionHeight);
        }
    }

    public void setSendActionState(int arg3, CellRef arg4, boolean arg5) {
        HashMap v0_1;
        if (this.mActionSendRecoder == null) {
            this.mActionSendRecoder = new ActionSendRecoder();
        }

        ActionSendRecoder v1 = this.mActionSendRecoder;
        if (v1.a == null) {
            v1.a = new SparseArrayCompat();
        }

        Object v0 = v1.a.get(arg3);
        if (v0 == null) {
            v0_1 = new HashMap();
            v1.a.put(arg3, v0_1);
            v0_1.put(arg4, Boolean.valueOf(arg5));
        }


    }

    protected void showDislikeNotify(CellRef arg11) {
        if ((this.isViewValid()) && arg11 != null) {
            this.mLastDislikedItem = arg11;
            int v4 = R.string.toast_dislike_success_anonymous;
            if (this.mSpipe != null && (this.mSpipe.isLogin)) {
                v4 = R.string.toast_dislike_success;
            }

            this.doShowNotify(2, null, v4, true, 5000, false, R.string.label_cancel_dislike);
        }
    }

    private void showDislikePopWindow(View arg7) {
        FragmentActivity v0 = this.getActivity();
        if (v0 != null && arg7 != null) {
            final ag v3 = new ag(((Context) v0));
            final View.OnClickListener v2 = this.mDislikeListener;
            if (v2 != null && v3.b != null) {
                v3.b.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        MobClickCombiner.onEvent(v3.a, "dislike", "confirm_no_reason");
                        v2.onClick(v);
                    }
                });
            }

            this.mDislikePopWindowRef = new WeakReference(v3);
            int[] v4 = new int[2];
            arg7.getLocationOnScreen(v4);
            int v2_1 = ((Activity) v0).getResources().getDimensionPixelSize(R.dimen.du);
            int v5 = v4[0];
            int v0_1 = v3.c == null ? 0 : v3.c.getMeasuredWidth();
            v2_1 = v5 - v0_1 + arg7.getPaddingLeft() - v2_1;
            int v4_1 = v4[1];
            v0_1 = v3.c == null ? 0 : v3.c.getMeasuredHeight();
            v0_1 = v4_1 - v0_1 / 2 + arg7.getPaddingTop() + (arg7.getHeight() - arg7.getPaddingTop() - arg7.getPaddingBottom()) / 2;
            if (v2_1 < 0) {
                v2_1 = 0;
            }

            if (v0_1 < 0) {
                v0_1 = 0;
            }

            if (v3.d == null) {
                return;
            }

            Animation v4_2 = AnimationUtils.loadAnimation(v3.a, R.anim.y);
            if (v4_2 != null && v3.c != null) {
                v3.c.startAnimation(v4_2);
            }

            v3.d.showAtLocation(arg7, 0, v2_1, v0_1);
            MobClickCombiner.onEvent(v3.a, "dislike", "menu_no_reason");
        }
    }

    public void showLoadingAnim() {
        if (this.mEmptyView != null) {
            this.mEmptyView.start();
        }
    }

    public void showNoDataView() {
        if (this.mNoDataView == null) {
            this.mNoDataView = android.support.design.a.a(this.getActivity(), this.getView(), ac.b(NoDataViewFactory$ImgType.NOT_FOUND), ad.a(this.getString(com.ss.android.article.browser.R.string.not_found_tip)), null);
        }

        UIUtils.setVisibility(this.mEmptyView, 8);
        this.mNoDataView.initNoDataActionBtn();
        this.mNoDataView.setVisibility(View.VISIBLE);
        if ("__all__".equals(this.getCategoryName())) {
            SubscriptionRouter.c(new FeedAdapter.b$b(false));
        }
    }

    public void showNoNetView() {
        if (!this.isDetached() && this.getActivity() != null) {
            if (this.mNoNetView == null) {
                this.mNoNetView = android.support.design.a.a(this.getActivity(), this.getView(), ac.b(NoDataViewFactory$ImgType.NOT_NETWORK), ad.a(this.getString(com.ss.android.article.browser.R.string.not_network_tip)), null);
            }

            if (this.mEmptyView != null && this.mEmptyView.getVisibility() == View.VISIBLE) {
                this.mEmptyView.setVisibility(View.GONE);
            }

            this.mNoNetView.initNoDataActionBtn();
            this.mNoNetView.setVisibility(View.VISIBLE);
            if (!"__all__".equals(this.getCategoryName())) {
                return;
            }

            SubscriptionRouter.c(new FeedAdapter.b$b(false));
        }
    }

    protected void showNotify(int arg2) {
        this.showNotify(arg2, true);
    }

    protected void showNotify(int arg11, boolean arg12) {
        this.doShowNotify(0, null, arg11, arg12, 2000, false, 0);
    }

    public void showNotify(AdsAppItem arg2, boolean arg3) {
        this.showNotify(arg2, arg3, -1);
    }

    protected void showNotify(AdsAppItem arg11, boolean arg12, int arg13) {
        if (this.isViewValid()) {
            this.mAdsAppItem = arg11;
            if (this.mNotifyView != null) {
                this.mNotifyView.setVisibility(View.GONE);
                this.mHandler.removeCallbacks(this.mHideNotifyTask);
            }

            if (android.support.design.a.isTextEmpty(this.mDefaultAds)) {
                this.mDefaultAds = this.getString(com.ss.android.article.browser.R.string.ss_have_a_rest);
            }

            if (!arg12 && arg13 > 0) {
                FragmentActivity v0 = this.getActivity();
                if (v0 == null) {
                } else if (arg11 != null) {
                    String v3 = "";
                    if (!android.support.design.a.isTextEmpty(arg11.displayTemplate)) {
                        v3 = arg11.displayTemplate.replace("%s", String.valueOf(arg13));
                    } else if (!android.support.design.a.isTextEmpty(arg11.displayInfo)) {
                        v3 = arg11.displayInfo;
                    }

                    if (android.support.design.a.isTextEmpty(v3)) {
                        return;
                    }

                    this.doShowNotify(1, v3, 0, true, arg11.displayDuration * 1000, false, 0);
                    MobClickCombiner.onEvent(v0, "notify", "tips_show", arg11.id, 0);
                    AppUtil.a(arg11.trackUrlList, this.getActivity());
                } else {
                }

                return;
            }

            this.doShowNotify(0, this.mDefaultAds, 0, true, 4000, false, 0);
        }
    }

    protected void showNotify(String arg2) {
        this.showNotify(arg2, true);
    }

    public void showNotify(String arg11, boolean arg12) {
        this.doShowNotify(0, arg11, 0, arg12, 2000, false, 0);
    }

    protected void showToast(int arg3, int arg4) {
        if (this.mPopupToast == null) {
            FragmentActivity v0 = this.getActivity();
            if (v0 != null) {
                this.mPopupToast = new PopupToast(((Context) v0));
                if (this.mListView != null) {
                    this.mPopupToast.showToast(arg3, arg4);
                }
            }
        } else {
            label_8:
            if (this.mListView != null) {
                this.mPopupToast.showToast(arg3, arg4);
            }
        }
    }

    public void stopLoadingAnim() {
        if (this.mEmptyView != null) {
            this.mEmptyView.stop();
        }
    }

    protected void superOnActivityCreated(Bundle arg1) {
        super.onActivityCreated(arg1);
    }

    protected void superOnViewCreated(View arg1, Bundle arg2) {
        super.onViewCreated(arg1, arg2);
    }

    public void tryRefreshTheme() {
        if (this.isViewValid()) {
            FragmentActivity activity = this.getActivity();
            if (activity != null) {
                boolean isNightMode = AppData.isNightMode();
                if (this.mIsNightMode != isNightMode) {
                    this.mIsNightMode = isNightMode;
                    this.onDayNightThemeChanged(activity.getResources(), isNightMode);
                }
            }
        }
    }

    public final class Footer extends AbstractFooter {
        private final ArticleListFragment mArticleListFragment;

        public Footer(ArticleListFragment articleListFragment, View view) {
            super(view);
            this.mArticleListFragment = articleListFragment;
        }

        public final void onUserClick() {
            this.mArticleListFragment.onLoadMoreClick();
        }
    }
}

